package refunds

import "yundian/internel/pkg/dingo"

type RefundModel struct {
	Id          int        `gorm:"column:id" json:"id"`
	Appid       string     `gorm:"column:appid" json:"-"`                  // Appid
	Mchid       string     `gorm:"column:mchid" json:"-"`                  // 商户ID

	TradeNo     string     `gorm:"column:trade_no" json:"tradeNo"`          // 订单号
	OutTradeNo  string     `gorm:"column:out_trade_no" json:"outTradeNo"`   // 第三方订单号
	RefundNo    string     `gorm:"column:refund_no" json:"refundNo"`        // 退款订单号
	OutRefundNo string     `gorm:"column:out_refund_no" json:"outRefundNo"` // 第三方退款订单号
	RefundFee   int64      `gorm:"column:refund_fee" json:"refundFee"`      // 退款金额
	TotalFee    int64      `gorm:"column:total_fee" json:"totalFee"`        // 订单总金额

	//REFUND_SOURCE_RECHARGE_FUNDS 可用余额退款/基本账户
	//REFUND_SOURCE_UNSETTLED_FUNDS 未结算资金退款
	RefundAccount       string     `gorm:"column:refund_account" json:"refundAccount"`               // 退款资金来源
	RefundRecvAccout    string     `gorm:"column:refund_recv_accout" json:"refundRecvAccout"`        // 退款入账账户
	//SUCCESS-退款成功
	//CHANGE-退款异常
	//REFUNDCLOSE—退款关闭
	RefundStatus        string     `gorm:"column:refund_status" json:"refundStatus"`                 // 退款状态
	RefundRequestSource string     `gorm:"column:refund_request_source" json:"refundRequestSource"`  // 退款发起来源
	SettlementRefundFee int64      `gorm:"column:settlement_refund_fee" json:"settlementRefundFee"`  // 退款金额
	SettlementTotalFee  int64      `gorm:"column:settlement_total_fee" json:"settlementTotalFee"`    // 应结订单金额

	SuccessTime  dingo.Time `gorm:"column:success_time" json:"successTime"` // 创建日期
	CreateAt     dingo.Time `gorm:"column:create_at" json:"createAt"`       // 创建日期
	UpdateAt     dingo.Time `gorm:"column:update_at" json:"updateAt"`       // 修改日期

	IsRef        uint `gorm:"column:is_ref" json:"isRef"`       // 修改日期
}

func New() *RefundModel {
	return &RefundModel{}
}